package cn.legend.travel.destination.keyword.dao.persist.repository.impl;


import cn.legend.travel.destination.keyword.dao.persist.mapper.DistrictMapper;
import cn.legend.travel.destination.keyword.dao.persist.repository.IDistrictRepository;
import cn.legend.travel.destination.keyword.pojo.vo.HotMonthDestinationVO;
import cn.legend.travel.destination.keyword.pojo.vo.KeywordVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 处理省市区数据的数据访问实现类
 *
 * @author java@tedu.cn
 * @version 1.0
 */
@Slf4j
@Repository
public class DistrictRepositoryImpl implements IDistrictRepository {

    @Autowired
    private DistrictMapper roleMapper;

    public DistrictRepositoryImpl() {
        log.debug("创建存储库对象：DistrictRepositoryImpl");
    }

//    @Override
//    public List<DistrictSimplePO> listByParent(Long parentId) {
//        log.debug("开始执行【根据父级查询子级地区列表】的数据访问，参数：{}", parentId);
//        return roleMapper.listByParent(parentId);
//    }

    @Override
    public List<KeywordVO> selectKeywordAll() {
        log.debug("开始执行【查询关键词列表】的数据访问");
        return roleMapper.selectKeywordAll();
    }

    @Override
    public List<HotMonthDestinationVO> listByKId(Long kId) {
        log.debug("开始执行【根据关键词id查询目的地列表】的数据访问，参数：{}", kId);
        return roleMapper.selectListByKId(kId);
    }

    @Override
    public List<KeywordVO> listByType(Long id) {
        log.debug("开始执行【查询关键词列表】的数据访问");
        return roleMapper.listByType(id);
    }
}
